export class DateUtil {

  /*
  根据时间戳获取距离当前月数
   */
  public static getMonth(date): string {
    const now = new Date().getTime();
    let dayStr;
    let days = (now - date) / 1000 / 3600 / 24 / 365;

    if (days < 1) {
      days = days * 12;
      if (days < 1) {
        days = days / 12 * 365;
        dayStr = days.toFixed(0) + '天';
      } else {
        dayStr = days.toFixed(0) + '月多';
      }
    } else {
      dayStr = days.toFixed(0) + '年多';
    }


    return dayStr;
  }




}
